<template>
	<h2>reactive的使用</h2>
</template>

<script lang="ts">
import { defineComponent, reactive } from "vue"

export default defineComponent({
	name: "App",
	// 需求:显示用户的相关数据，点击按钮，可以更新用户的相关信息数据
	setup() {
		const user = reactive({
			name: "小明",
			age: 20,
			wife: {
				name: "小甜甜",
				age: 18,
				cars: ["奔驰", "宝马", "劳斯莱斯"]
			}
		})
		return {
			user
		}
	}
})
</script>
